<template lang="html">
  <div class="pay-success">
    <div class="content">
      <div class="information">
        <div class="info">
          <h2 class="title">订单支付成功</h2>
          <div class="order-number">
            订单号:
            <span class="number">{{orderNumber}}</span>
          </div>
          <div class="order-num">
            订单金额:
            <span class="num">{{orderNum}}</span>
            元
          </div>
        </div>
        <i class="icon"></i>
      </div>
      <div class="link">
        你可以：
        <a class="per" @click="linkOrderMachine">查看算力明细</a> &nbsp;|&nbsp;
        <a class="per" @click="linkIndex">返回个人中心</a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      orderNumber: '',
      orderNum: 0
    }
  },
  beforeRouteEnter (to, from, next) {
    next(vm => {
      vm.orderNumber = vm.$route.query.out_trade_no
      vm.orderNum = vm.$route.query.total_amount
    })
  },
  methods: {
    linkOrderMachine () {
      this.$router.push({
        path: '/order/list'
      })
    },
    linkIndex () {
      this.$router.push({
        path: '/index'
      })
    }
  }
}
</script>

<style lang="stylus" scoped>
  .pay-success
    width 100%
    .content
      width 1000px
      min-height 500px
      margin 20px auto
      padding 20px 50px
      padding 80px 10px 20px 100px
      background: #fff
      .information
        font-size 0
        .info
          display inline-block
          width 330px
          .title
            height 40px
            line-height 20px
            font-size 20px
            color #36951b
          .order-number
            height 28px
            line-height 28px
            font-size 14px
            color #63666c
          .order-num
            height 28px
            line-height 28px
            font-size 14px
            color #63666c
            .num
              font-size 14px
              color #e26272
        .icon
          display inline-block
          width 112px
          height 66px
          background url(../../common/image/icon/icon-success.png) no-repeat 50%
          background-size 112px 66px
      .link
        width 100%
        padding-top 60px
        line-height 28px
        color #666
        font-size 14px
        .per
          color #4da1ff
</style>
